<script type="text/javascript">
function ValidatePage(frm)
{
	var subject = document.getElementById('subject').value;
	var message = document.getElementById('message').value;
	
	if(subject == "") {
		alert("Subject is missing");
		return false;
	}
	if(message == "") {
		alert("Message is missing");
		return false;
	}
	else {
		document.getElementById('process').value = 'reply';
		document.frm.submit();
	}
	return false;
}
</script>
<?php

$query = mysql_query("select `name`, `email`, `advt_item`, `advt_days`, DATE_FORMAT(created_datetime,'%d-%m-%Y') as insdate  from banner_ad_query where id='".$_REQUEST['_d']."'") or die(mysql_error());

$res = mysql_fetch_array($query);

?>
<table border="0" width="100%" align="center">
<tr>
	<td width="46%" align="left"><span style="color:#1B78B7; font-size:14px; font-weight:bold">
    Reply Query</span>&nbsp; 
	<!--<input type="button" name="addnew" value="Add New" onclick="return show();" />-->
	</td>
</tr>
<tr>
	<td background="images/topline.gif" colspan="3" height="11"></td>
</tr>    
</table>

<form name="formPage" method="post" action="action.php" enctype="multipart/form-data" onSubmit="return ValidatePage(this);">
<table width="99%" align="center" border="0"  class="list">
<tr>
	<td align="right" width="250">Email</td>
    <td align="left"><?php echo $res['email'];?></td>
</tr>
<tr>
	<td align="right" width="250">Subject</td>
    <td align="left"><input name="subject"  id="subject" type="text" value="" style="width:400px;"/></td>
</tr>
<tr>
	<td align="right" width="250">Message</td>
    <td align="left"><textarea class="text" name="message"  id="message" style="width:400px; height:200px;"></textarea></td>
</tr>
<tr>
	<td align="right" width="250">Attachment*</td>
    <td align="left"><input  name="attach" id="attach" type="file" value="" style="width:400px;"/></td>
</tr>
<tr>
	<td align="right" width="150"></td>
    <td align="left">
    
    <input name="email" id="email" type="hidden" value="<?php echo $res['email'];?>"/>
    <input name="module" id="module" type="hidden" value="banner_ads"/>
    <input name="process" id="process" type="hidden" value=""/>
    <input type="submit" value="Submit" name="save_gadgettech">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>